<?php
    require_once('../includes/DbConnector.php');
    if(isset($_POST['action']) && !empty($_POST['action'])) {
        // INPUT DATA.
        $name = $_POST['name'];
        $country = $_POST['country'];
        $description = $_POST['description'];
        $postal_no = $_POST['postal_no'];
        $place = $_POST['place'];
        $address = $_POST['address'];
        $cover_charge = $_POST['cover_charge'];
        $beer_price = $_POST['beer_price'];
        $age_limit = $_POST['age_limit'];
        $user_id = $_POST['user_id'];
        $status_id = $_POST['status_id'];
        $facebook_user = $_POST['facebook_user'];
        $twitter_user = $_POST['twitter_user'];
        $instagram_user = $_POST['instagram_user'];
        $spotify_user = $_POST['spotify_user'];
        $hashtag = $_POST['hashtag'];
        $connector  = new DbConnector();
        
        $sql = "INSERT INTO bar(name, country, description, postal_no, place, address, cover_charge, beer_price, age_limit, user_id, status_id, facebook_user, twitter_user, instagram_user, spotify_user, hashtag) 
                VALUES('$name', '$country', '$description', '$postal_no', '$place', '$address', '$cover_charge', '$beer_price', '$age_limit', '$user_id', '$status_id', '$facebook_user', '$twitter_user', '$instagram_user', '$spotify_user', '$hashtag');";
        $result = $connector->query($sql);
        
        echo "Success";
    }
?>